
var clients = []
onconnect = function(e) {
  var port = e.ports[0]
  clients.push(port)
  port.addEventListener('message', function(event) {
    clients.forEach(item => {
      item.postMessage(event.data)
    })
  })
  port.start()
}